Method : POST
Syntax : {host}:{port}/_admin/api/route/{routeId}
Rest API : curl -H "Content-Type: application/json" -X POST -d '{"variant":"preorder"}' http://localhost:8000/_admin/api/route/getCollection?returnConfig=true
midway.route({
id: 'getCollection',
label: 'Get Collection',
path: '/product/grouping/api/collection/{collectionId}',
variantLabel: 'default',
handler: function(req, reply) {
var response = getResponseData('/product/grouping/api/collection', 'default');
reply(response);
}
})
.variant({
id: 'preorder',
label: 'Get Pre-order Collection',
handler: function (req, reply) {
reply({message: 'hello pre-order'});
}
});
To get the config back as a response, add query parameter
returnConfig=true
as shown in example above
Method : GET
Syntax : {host}:{port}/_admin/api/midway/setMockId/{mockid}/{sessionid}
Rest API : curl http://localhost:8000/_admin/api/midway/setMockId/1234/default
Method : GET
Syntax : {host}:{port}/_admin/api/midway/getMockId/{sessionid}
Rest API : curl http://localhost:8000/_admin/api/midway/getMockId/default
Method : GET
Syntax : {host}:{port}/_admin/api/midway/resetMockId/{sessionid}
Rest API : curl http://localhost:8000/_admin/api/midway/resetMockId/default
Method : GET
Syntax : {host}:{port}/_admin/api/midway/getURLCount/{sessionid}
Rest API : curl http://localhost:8000/_admin/api/midway/getURLCount/default
Method : GET
Syntax : {host}:{port}/_admin/api/midway/resetURLCount/{sessionid}
Rest API : curl http://localhost:8000/_admin/api/midway/resetURLCount/default
Method : POST
Syntax : {host}:{port}/_admin/api/state/reset
Rest API : curl -X POST http://localhost:8000/_admin/api/state/reset
Method : GET
Syntax : {host}:{port}/_admin/api/midway/registerSession
Rest API : curl http://localhost:8000/_admin/api/midway/registerSession
Method : GET
Syntax : {host}:{port}/_admin/api/midway/getSessions
Rest API : curl http://localhost:8000/_admin/api/midway/getSessions
Method : GET
Syntax : {host}:{port}/_admin/api/midway/checkSession/{sessionid}
Rest API : curl http://localhost:8000/_admin/api/midway/checkSession/{sessionid}
Method : GET
Syntax : {host}:{port}/_admin/api/midway/closeSession/{sessionid}
Rest API : curl http://localhost:8000/_admin/api/midway/closeSession/{sessionid}